using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.ObjectBuilder;
using Microsoft.Practices.CompositeWeb;
using System.Transactions;
using GC2.Entities.Admin;
using GC2.Entities.Seguridad;
using GC2.Bussines.BMSeguridad;
using GC2.ExceptionHandler.Services;
using GC2.DataAccess.DAAdmin;

namespace GC2.Bussines.BMAdmin
{
    public class BMPaseCaja
    {
        public BMPaseCaja(string coneccion) 
        {
            this.Connection = coneccion;
        }

        private string connection = "";
        public string Connection
        {
            get { return connection; }
            set { connection = value; }
        }

        DAPaseCaja daPase = new DAPaseCaja();
        List<PaseCaja> listaPases = new List<PaseCaja>();

        #region BMPaseCajaGetAllByDestino
        public List<PaseCaja> BMPaseCajaGetAllByDestino(PaseCaja pase)
        {
            try
            {
                listaPases = daPase.DAPaseCaja_GetAllByDestino(Connection, pase);
                return listaPases;
            }
            catch (Exception ex)
            {
                ExceptionBM exNew = new ExceptionBM();
                throw new System.Exception(exNew.exBM(ex.ToString()).ToString());
            }
        }
        #endregion

        #region BMPaseCajaInsert
        public PaseCaja BMPaseCajaInsert(PaseCaja pase)
        {
            try
            {
                pase = daPase.DAPaseCajaInsert(Connection, pase);
                return pase;
            }
            catch (Exception ex)
            {
                ExceptionBM exNew = new ExceptionBM();
                throw new System.Exception(exNew.exBM(ex.ToString()).ToString());
            }
        }
        #endregion
    }
}
